<?php

/**
 * 控制器基类
 * 
 * @package    01CMS
 * @subpackage system
 * @author     rolong at vip.qq.com
 * @version    1.0.0
 * @link       http://www.01cms.com
 */

class Controller extends Base
{

	function __construct ()
	{
		parent::__construct();
		
		$this->Load = & $GLOBALS['Load'];
		$this->Uri = & $GLOBALS['Uri'];
		$this->c = & $GLOBALS['c'];
		$this->m = & $GLOBALS['m'];
		$this->p = & $GLOBALS['p'];
	}

	/**
	 * 动作调度
	 * 
	 * @param 		string $action lists|add|insert|mod|update|del
	 * @return 		void
	 * @access 		protected
	 */
	protected function action ($action)
	{
		$this->Action = lib('Action');
		
		if (empty($action) || ! method_exists($this->Action, $action))
		{
			showError('404');
		}
		
		$this->Action->$action();
	}
}

// END